import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
import { h } from 'vue';
import { Tag } from 'ant-design-vue';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '序号',
    dataIndex: 'index',
    align: 'center',
    width: 60,
    customRender: ({ index }) => index + 1,
    fixed: 'left',
  },
  {
    title: '客户',
    align:"center",
    dataIndex: 'customerName'
  },
  {
    title: '合同主题',
    align:"center",
    dataIndex: 'contractTheme'
  },
  {
    title: '币种',
    align:"center",
    dataIndex: 'currencyType'
  },
  {
    title: '合同金额',
    align:"center",
    dataIndex: 'amount'
  },
  {
    title: '到账总额',
    align:"center",
    dataIndex: 'arriveAmount'
  },

  {
    title: '产品类型',
    align:"center",
    dataIndex: 'productType'
  },
  {
    title: '产品内容',
    align:"center",
    dataIndex: 'productContent',
    ellipsis: true,
    width: 200
  },
  {
    title: '签订人',
    align:"center",
    dataIndex: 'contractSignName'
  },
  {
    title: '签订日期',
    align:"center",
    dataIndex: 'createTime',
    customRender:({text}) =>{
      text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
      return text;
    },
  },
  {
    title: '开始日期',
    align:"center",
    dataIndex: 'startDate',
    customRender:({text}) =>{
      text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
      return text;
    },
  },
  {
    title: '结束日期',
    align:"center",
    dataIndex: 'endDate',
    customRender:({text}) =>{
      text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
      return text;
    },
  },

];

//子表列表数据
export const contractAmountInfoColumns: BasicColumn[] = [
  {
    title: '序号',
    dataIndex: 'index',
    align: 'center',
    width: 60,
    customRender: ({ index }) => index + 1,
    fixed: 'left',
  },
  {
    title: '合同总额',
    align:"center",
    dataIndex: 'amount'
  },
  {
    title: '优惠总额',
    align:"center",
    dataIndex: 'discountAmount'
  },
  {
    title: '实际总额',
    align:"center",
    dataIndex: 'realAmount'
  },
  {
    title: '收款类型',
    align:"center",
    dataIndex: 'paymentType_dictText'
  },
  {
    title: '开票类型',
    align:"center",
    dataIndex: 'trickType_dictText'
  },
  {
    title: '运杂费',
    align:"center",
    dataIndex: 'freightCharge'
  },
  {
    title: '账期',
    align:"center",
    dataIndex: 'billingPeriod'
  },
];
//子表列表数据
export const contractDetailInfoColumns: BasicColumn[] = [
  {
    title: '序号',
    dataIndex: 'index',
    align: 'center',
    width: 60,
    customRender: ({ index }) => index + 1,
    fixed: 'left',
  },
  {
    title: '单位名称',
    align:"center",
    dataIndex: 'itemName'
  },
  // 隐藏合同编号列
  // {
  //   title: '合同编号',
  //   align:"center",
  //   dataIndex: 'contractNumber'
  // },
  {
    title: '单位',
    align:"center",
    dataIndex: 'unit'
  },
  {
    title: '产品类型',
    align:"center",
    dataIndex: 'productType'
  },
  {
    title: '产品内容',
    align:"center",
    dataIndex: 'productContent',
    ellipsis: true,
    width: 200
  },
  {
    title: '数量',
    align:"center",
    dataIndex: 'allCount'
  },
  {
    title: '合同金额',
    align:"center",
    dataIndex: 'amount'
  },
  {
    title: '到账总额',
    align:"center",
    dataIndex: 'arriveAmount'
  },
  {
    title: '第三方支出',
    align:"center",
    dataIndex: 'thirdExpense'
  },
  {
    title: '合同净额',
    align:"center",
    dataIndex: 'netAmount'
  },
  {
    title: '含税单价',
    align:"center",
    dataIndex: 'taxPrice'
  },
];

// 高级查询数据
export const superQuerySchema = {
  customerName: {title: '客户',order: 1,view: 'text', type: 'string',},
  contractTheme: {title: '合同主题',order: 2,view: 'text', type: 'string',},
  currencyType: {title: '币种',order: 4,view: 'text', type: 'string',},
  amount: {title: '合同金额',order: 5,view: 'number', type: 'number',},
  arriveAmount: {title: '到账总额',order: 6,view: 'number', type: 'number',},
  createTime: {title: '签订日期',order: 11,view: 'date', type: 'string',},
  endDate: {title: '结束日期',order: 12,view: 'date', type: 'string',},
  startDate: {title: '开始日期',order: 13,view: 'date', type: 'string',},
  productType: {title: '产品类型',order: 14,view: 'text', type: 'string',},
  productContent: {title: '产品内容',order: 15,view: 'text', type: 'string',},
  contractSignName: {title: '签订人',order: 16,view: 'text', type: 'string',},
};
